package com.xdtech.hotel.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.sql.Timestamp;

import com.xdtech.core.orm.utils.BeanUtils;
import com.xdtech.hotel.model.HotelInfo;

import com.xdtech.web.freemark.item.GridColumn;

/**
 * 
 * @author max.zheng
 * @create 2015-04-04 11:00:12
 * @since 1.0
 * @see
 */
public class HotelInfoItem implements Serializable{
	private static final long serialVersionUID = 1L;
	private Long id;
	@GridColumn(title="酒店名称",width=200)
	private String name;
	@GridColumn(title="酒店地址",width=200)
	private String address;
	@GridColumn(title="酒店地址",width=100)
	private String contacts;
	@GridColumn(title="酒店电话",width=100)
	private String telephone;
	

	public void setId(Long id) {
		this.id = id;
	}
	public Long getId() {
		return id;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	public String getName() {
		return name;
	}
	
	public void setAddress(String address) {
		this.address = address;
	}
	public String getAddress() {
		return address;
	}
	
	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}
	public String getTelephone() {
		return telephone;
	}
	
	public String getContacts() {
		return contacts;
	}
	public void setContacts(String contacts) {
		this.contacts = contacts;
	}
	/**
	 * 根据model构建vo
	 * 
	 * @author max
	 * @return
	 */
	public static HotelInfoItem createItem(HotelInfo hotelInfo) {
		HotelInfoItem hotelInfoItem = new HotelInfoItem();
		BeanUtils.copyProperties(hotelInfoItem, hotelInfo);
		//自定义属性设置填充
		return hotelInfoItem;
	}
	/**
	 * 根据model集合创建vo集合
	 * 
	 * @author max
	 * @return
	 */
	public static List<HotelInfoItem> createItems(List<HotelInfo> hotelInfos) {
		List<HotelInfoItem> hotelInfoItems = new ArrayList<HotelInfoItem>();
		for (HotelInfo hotelInfo : hotelInfos) {
			hotelInfoItems.add(createItem(hotelInfo));
		}
		return hotelInfoItems;
	}
}
